using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Game.Example
{
    public class UniTaskExample : MonoBehaviour
    {
        [Button("NextFrame")]
        public void TestPlayer()
        {
            TestPlayerLoop(PlayerLoopTiming.Update);
        }
        
        //使用aysnc UniTask
        async UniTaskVoid TestPlayerLoop(PlayerLoopTiming timing)
        {
            Debug.Log($"{timing} -> {Time.frameCount}");
            await UniTask.NextFrame();
            Debug.Log($"{timing} -> {Time.frameCount}");
        }
    }
}


